<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./lib/vue.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/vue-resource@1.5.2"></script>
    
</head>
<body>
    <div id="app">
        <input type="button" value="get请求" @click="getInfo">

        </div>
    
    <script>
 /* get请求：https://jsonplaceholder.typicode.com/todos/1
    post请求：http://jsonplaceholder.typicode.com/users */
       
        var vm = new Vue({
            el:"#app",
            data:{},
            methosd:{
                getInfo(){
                    this.$http.get("https://jsonplaceholder.typicode.com/todos/1").then(function(data){
                        console.log(data.body)
                    })
                }
            },

        });
    </script>
    
</body>
</html>